home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1993 / Internet Info CD-ROM (Walnut Creek) (1993).iso / networking / news / nntp / nntp.sco.patch < prev    next >
Encoding:
Internet Message Format  |  1991-09-18  |  9.4 KB

  1. Path: uunet!xstor!iverson
  2. From: iverson@xstor.com (Tim Iverson)
  3. Newsgroups: alt.sources
  4. Subject: Patches for NNTP 1.5.11 under SCO Unix
  5. Message-ID: <1991Jun26.000807.7560@xstor.com>
  6. Date: 26 Jun 91 00:08:07 GMT
  7. Reply-To: iverson@xstor.com
  8. Followup-To: alt.sources.d
  9. Organization: Storage Dimensions, Inc.
  10. Lines: 367
  11.  
  12.  
  13. This patch file requires patch-2.0.2.0 patchlevel 12u4.  You might have some
  14. success with unipatch or earlier 12u* versions of patch, but you're on your
  15. own there.  It makes the standard nntp-1.5.11 distribution compile and run
  16. under SCO Unix 3.2.2 with TCP/IP 1.1.1b.
  17.  
  18. What it does:    modify setup (conf.h) and makefiles as used for xstor.com
  19.         modify server/main.c to do a setluid (ugly c2-ism)
  20.         minor mods to several other files (use statfs, etc.)
  21.  
  22. To apply:    cd nntp-1.5.11
  23.         cp common/conf.h.dist common/conf.h
  24.         patch -p < this_file
  25.         edit conf.h (at least change "xstor.com" to something else)
  26.  
  27. To compile:    You must have libcnews.a (created when you built cnews) in
  28.         one of the places searched by ld; e.g. /lib or perhaps
  29.         /usr/local/lib/gcc.
  30.  
  31. N.B.    This patch has only been tested with gcc-1.39-SCO.3 (i.e. 1.39 with
  32.     all of my SCO patches applied).  It will probably work equally well
  33.     with the standard dev-sys.
  34.  
  35. - Tim Iverson
  36.   iverson@xstor.com -/- uunet!xstor!iverson
  37.  
  38. #
  39. ################ patch starts here
  40. ##
  41. Prereq: "1.5.11a (1 April 1991)";
  42. Index: common/version.c
  43. @@ -3,3 +3,3 @@
  44. = */
  45. =
  46. -char    nntp_version[] = "1.5.11a (1 April 1991)";
  47. +char    nntp_version[] = "1.5.11a (1 April 1991) SCO.0";
  48. Index: Makefile
  49. @@ -7,5 +7,5 @@
  50. =CFLAGS= -O 
  51. =# set LIBS to be -lneededlibrary if needed
  52. -LIBS=-ldbm
  53. +LIBS=-lcnews -lsocket -lx -lprot
  54. =
  55. =DISTFILES = Makefile README CHANGES
  56. Index: common/conf.h
  57. @@ -22,5 +22,5 @@
  58. = * at some sites, so it is an option. Please report problems to "nntp@tmc.edu"
  59. = */
  60. -#undef DYNAMIC_ART_ARRAY
  61. +#define DYNAMIC_ART_ARRAY
  62. =
  63. =#undef    BSD_42        /* 4.2 compatability code -- if this is defined, */
  64. @@ -27,9 +27,9 @@
  65. =            /* DBM probably wants to be defined as well. */
  66. =
  67. -#define BSD_43        /* Define if you are running on BSD 4.3 */
  68. +#undef    BSD_43        /* Define if you are running on BSD 4.3 */
  69. =
  70. =#undef CMU_MACH        /* Use CMU's MACH ioctl(FIOCFSPARAM) for dfree(). */
  71. =
  72. -#undef    USG        /* System V support */
  73. +#define    USG        /* System V support */
  74. =
  75. =#undef TLI        /* Define this if you want to use TLI instead of */
  76. @@ -36,5 +36,5 @@
  77. =            /* sockets */
  78. =
  79. -#define NDBM        /* Use new-style (4.3) ndbm(3x) libraries */
  80. +#undef    NDBM        /* Use new-style (4.3) ndbm(3x) libraries */
  81. =
  82. =#undef    DBM        /* True if we want to use the old dbm(3x) libraries */
  83. @@ -42,5 +42,5 @@
  84. =            /* be -ldbm */
  85. =
  86. -#undef    DBZ        /* True if we want to use dbz libraries */
  87. +#define    DBZ        /* True if we want to use dbz libraries */
  88. =            /* IF YOU DEFINE THIS, change CFLAGS in makefile to */
  89. =            /* be /usr/lib/dbz.o and install dbz.h */
  90. @@ -49,6 +49,6 @@
  91. =            /* IF YOU DO NOT DEFINE NDBM or DBM, this is DEFAULT!*/
  92. =
  93. -#undef CNEWS        /* define this if you are running C-NEWS */
  94. -#undef BATCHED_INPUT    /* define if you want to support C-NEWS style 
  95. +#define    CNEWS        /* define this if you are running C-NEWS */
  96. +#undef    BATCHED_INPUT    /* define if you want to support C-NEWS style 
  97. =                batched input (not supported by B-NEWS,yet)  */
  98. =
  99. @@ -63,6 +63,6 @@
  100. =#define SIGRET void    /* Newfangled signal() returns void, old returns int */
  101. =
  102. -#define    GHNAME        /* Define if you have gethostname() */
  103. -#undef    UUNAME        /* Define to use /etc/uucpname */
  104. +#undef    GHNAME        /* Define if you have gethostname() */
  105. +#define    UUNAME        /* Define to use /etc/uucpname */
  106. =            /* If neither of these are defined, */
  107. =            /* inews will use the contents of */
  108. @@ -76,10 +76,10 @@
  109. = */
  110. =
  111. -/* #define    vfork fork */
  112. +#define    vfork fork
  113. =
  114. =/* Controlling disk and inode consumption */
  115. -#define MINFREE 4000    /* NNTP will not allow an XFER if there is less */
  116. +#define MINFREE 500    /* NNTP will not allow an XFER if there is less */
  117. =            /* than this much diskspace (in blocks or kbytes) */
  118. -#define POSTBUFFER 1000 /* NNTP will allow local posting until */
  119. +#define POSTBUFFER 100    /* NNTP will allow local posting until */
  120. =            /* MINFREE-POSTBUFFER blocks or kbytes are left */
  121. =#undef MINFILES  MINFREE/4
  122. @@ -112,5 +112,5 @@
  123. = */
  124. =
  125. -/* #define UMASK 022 */
  126. +#define UMASK 022
  127. =
  128. =/*
  129. @@ -134,6 +134,6 @@
  130. = */
  131. =
  132. -#undef    FAKESYSLOG    "/usr/lib/news/nntplog"
  133. -#undef    FAKEAPPEND
  134. +#define    FAKESYSLOG    "/usr/lib/news/nntplog"
  135. +#define    FAKEAPPEND
  136. =
  137. =#define    SYSLOG    LOG_NEWS
  138. @@ -140,5 +140,5 @@
  139. =
  140. =#ifdef SYSLOG        /* Define LOG if you want copious logging info */
  141. -#undef     LOG        /* undef it if you don't */
  142. +# undef    LOG        /* undef it if you don't */
  143. =#endif            /* but you can only have LOG if you have SYSLOG */
  144. =
  145. @@ -182,6 +182,6 @@
  146. = */
  147. =
  148. -#define    DOMAIN    "uucp"
  149. -#undef HIDDENNET
  150. +#define    DOMAIN    "xstor.com"
  151. +#define    HIDDENNET
  152. =
  153. =/*
  154. @@ -201,5 +201,5 @@
  155. =/* Things that relate to authentication and access */
  156. =/* Define AUTH to use the proposed NNTP Version 2 authentication protocol. */
  157. -#define    AUTH    
  158. +#undef    AUTH    
  159. =/*
  160. = * A file containing the name of the host which is running
  161. @@ -208,5 +208,5 @@
  162. = */
  163. =
  164. -#define    SERVER_FILE    "/usr/local/lib/rn/server"
  165. +#define    SERVER_FILE    "/usr/local/lib/trn/server"
  166. =
  167. =/*
  168. @@ -214,5 +214,5 @@
  169. = */
  170. =
  171. -#define    POSTER        "usenet"
  172. +#define POSTER        "news"
  173. =
  174. =/*
  175. @@ -340,13 +340,13 @@
  176. =
  177. =#ifdef USG
  178. -# define    FCNTL            /* If O_etc is defined in <fcntl.h> */
  179. -#ifdef dgux
  180. -#define        FTRUNCATE
  181. -#else
  182. -# define    NDIR            /* If you  need ndir library support */
  183. -#ifdef hpux
  184. -#define        DIRSIZ_MACRO
  185. -#endif
  186. -#endif
  187. +# define    FCNTL        /* If O_etc is defined in <fcntl.h> */
  188. +# ifdef dgux
  189. +#  define    FTRUNCATE
  190. +# else
  191. +#  define    NDIR        /* If you  need ndir library support */
  192. +#  ifdef hpux
  193. +#   define    DIRSIZ_MACRO
  194. +#  endif
  195. +# endif
  196. =# define    index    strchr
  197. =# define    rindex    strrchr
  198. @@ -365,4 +365,2 @@
  199. =#define    MAX_ARTICLES    4096        /* Maximum number of articles/group */
  200. =#define READINTVL    60 * 10        /* 10 minutes b/n chking active file */
  201. -
  202. -
  203. Index: doc/Makefile
  204. @@ -29,7 +29,7 @@
  205. =
  206. =install: $(MANPAGES)
  207. -    mv nntpd.8c $(MANDIR)/man8/nntpd.8c
  208. -    mv mkgrdates.8c $(MANDIR)/man8/mkgrdates.8c
  209. -    mv nntpxmit.1 $(MANDIR)/man1/nntpxmit.1
  210. +    mv nntpd.8c $(MANDIR)/man.N/nntpd.N
  211. +    mv mkgrdates.8c $(MANDIR)/man.N/mkgrdates.N
  212. +    mv nntpxmit.1 $(MANDIR)/man.N/nntpxmit.N
  213. =
  214. =print: $(MANPAGES)
  215. Index: inews/Makefile
  216. @@ -14,5 +14,5 @@
  217. =
  218. =inews:  $(OBJS) $(HFILES)
  219. -    $(CC) $(CFLAGS) $(OBJS) -o inews $(LIBS)
  220. +    $(CC) -s $(CFLAGS) $(OBJS) -o inews $(LIBS)
  221. =
  222. =uname.o: uname.c ../common/conf.h
  223. Index: inews/uname.c
  224. @@ -57,4 +57,6 @@
  225. =    FILE *uucpf;
  226. =    register char *p;
  227. +    extern    char *index();
  228. +
  229. =    /* uucp name is stored in /etc/uucpname or /local/uucpname */
  230. =
  231. Index: server/Makefile
  232. @@ -31,5 +31,5 @@
  233. =
  234. =nntpd: ${SRVROBJ} ${SRVRINC} ${THREADS}
  235. -    ${CC} ${CFLAGS} -o nntpd ${SRVROBJ} ${THREADS} ${LIBS}
  236. +    ${CC} -s ${CFLAGS} -o nntpd ${SRVROBJ} ${THREADS} ${LIBS}
  237. =
  238. =${SRVROBJ}: ${SRVRINC}
  239. Index: server/main.c
  240. @@ -36,5 +36,33 @@
  241. =char **argv, **envp;
  242. ={
  243. +#ifdef    M_UNIX
  244. +    extern int    errno;
  245. +    extern char    *sys_errlist[];
  246. +    register int    luid, lgid;
  247. =
  248. +# ifdef    POSTER    /* try to get the desired luid */
  249. +    {
  250. +        struct passwd *p = getpwnam(POSTER);
  251. +
  252. +        if (p)
  253. +            luid = p->pw_uid, lgid = p->pw_gid;
  254. +        else
  255. +            luid = lgid = 0;
  256. +
  257. +        if (setluid(luid))
  258. +            setluid(luid = lgid = 0);
  259. +    }
  260. +# else
  261. +    setluid(luid = lgid = 0);
  262. +# endif
  263. +
  264. +    if (setgid(lgid) || setuid(luid))
  265. +    {
  266. +        printf("LUID not set! syserr[%d]=%s\n",
  267. +            errno, sys_errlist[errno]);
  268. +        exit(1);
  269. +    }
  270. +#endif
  271. +
  272. =#ifdef ALONE    /* If no inetd */
  273. =
  274. Index: server/misc.c
  275. @@ -615,5 +615,5 @@
  276. =}
  277. =#endif USGHIST
  278. -#ifdef USG
  279. +#if defined(USG) && !defined(M_UNIX)
  280. =#ifndef GAZETTE
  281. =bcopy(s, d, l)
  282. @@ -724,5 +724,5 @@
  283. =#endif 
  284. =
  285. -#if defined(apollo)
  286. +#if defined(apollo) || defined(M_UNIX)
  287. =#include <sys/types.h>
  288. =#include <sys/statfs.h>
  289. @@ -753,5 +753,5 @@
  290. =#endif 
  291. =
  292. -#if defined(USG) && !defined(hpux)
  293. +#if defined(USG) && !defined(hpux) && !defined(M_UNIX)
  294. =#include <ustat.h>
  295. =typedef struct ustat statfs_type;
  296. Index: server/spawn.c
  297. @@ -62,5 +62,5 @@
  298. =#endif
  299. =#ifdef XFER_TIMEOUT
  300. -    int        xfer_timeout();
  301. +    SIGRET        xfer_timeout();
  302. =#endif
  303. =#ifdef USG
  304. @@ -260,5 +260,5 @@
  305. =                if (errbuf) {
  306. =                    if (cp = index(line, '\n'))
  307. -                        *cp = '\0';
  308. +                        *cp = '\\';
  309. =                    (void) strcat(errbuf, line);
  310. =                }
  311. @@ -317,4 +317,5 @@
  312. =#ifdef XFER_TIMEOUT
  313. =
  314. +SIGRET
  315. =xfer_timeout()
  316. ={
  317. Index: server/timer.c
  318. @@ -70,5 +70,5 @@
  319. =    register struct timer *tp;
  320. =    register long secs;
  321. -#ifdef USG
  322. +#if defined(USG) && !defined(FD_SET)
  323. =    long timeout;
  324. =    long readfds;
  325. @@ -84,5 +84,5 @@
  326. =
  327. =    /* Length of next timeout is minimum of all "timers" */
  328. -#ifdef USG
  329. +#if defined(USG) && !defined(FD_SET)
  330. =    timeout = -1;
  331. =    for (i = ntimer, tp = timers; i > 0; --i, ++tp)
  332. Index: support/Makefile
  333. @@ -18,5 +18,5 @@
  334. =
  335. =mkgrdates: mkgrdates.o
  336. -    $(CC) ${CFLAGS} -o mkgrdates mkgrdates.o
  337. +    $(CC) -s ${CFLAGS} -o mkgrdates mkgrdates.o
  338. =
  339. =install: mkgrdates
  340. Index: xfer/Makefile
  341. @@ -11,5 +11,5 @@
  342. =
  343. =nntpxfer: ${SRVROBJ}
  344. -    ${CC} ${LDFLAGS} ${SRVROBJ} -o nntpxfer ${LIBS}
  345. +    ${CC} -s ${LDFLAGS} ${SRVROBJ} -o nntpxfer ${LIBS}
  346. =
  347. =get_tcp_conn.o: ../xmit/get_tcp_conn.c ../xmit/get_tcp_conn.h
  348. Index: xmit/Makefile
  349. @@ -23,8 +23,8 @@
  350. =
  351. =nntpxmit: ${SRVROBJ} ${SRVRINC}
  352. -    ${CC} ${CFLAGS} -o nntpxmit ${SRVROBJ} ${LIBS}
  353. +    ${CC} -s ${CFLAGS} -o nntpxmit ${SRVROBJ} ${LIBS}
  354. =
  355. =shlock: shlock.c
  356. -    cc ${CFLAGS} -DNNTPSRC -o shlock shlock.c
  357. +    $(CC) -s ${CFLAGS} -DNNTPSRC -o shlock shlock.c
  358. =
  359. =${SRVROBJ}: ${SRVRINC}
  360. Index: xmit/get_tcp_conn.c
  361. @@ -143,5 +143,5 @@
  362. =#endif    NONETDB
  363. =
  364. -#ifdef    USG
  365. +#if defined(USG) && !defined(M_UNIX)
  366. =void
  367. =bcopy(s, d, l)
  368. Index: xmit/nntpxmit.c
  369. @@ -156,5 +156,5 @@
  370. =extern    char    *strcat();
  371. =
  372. -#ifdef    USG
  373. +#if defined(USG) && !defined(M_UNIX)
  374. =void
  375. =bzero(s, l)
  376. ##
  377. ################ patch ends here
  378. #
  379.